package com.groupbuying.file.service;

import org.springframework.core.io.Resource;
import org.springframework.http.ResponseEntity;

import java.util.List;
import java.util.Map;

/**
 * @anthor wenguoqiang
 * @date: 2019/02/19 11:52
 * @company 够样
 * @des
 **/
public interface FileService {

    /**
     * 上传单
     * @param mapParams
     * @return
     * @throws Exception
     */
    Map<String, Object> uploadFile(Map<String, Object> mapParams);

    /**
     * 上传多文件
     * @param mapParams
     * @return
     * @throws Exception
     */
    Map<String, Object> uploadMoreFiles(Map<String, Object> mapParams) throws Exception;

    /**
     * 临时访问
     * @param mapParams
     * @return
     */
    Map<String, Object> tempVisit(Map<String, Object> mapParams);

    /**
     * 单下载文件
     * @param mapParams
     * @return
     */
    Map<String, Object> singleDownLoadFile(Map<String, Object> mapParams);

    /**
     * 获取文件流
     * @param fileUuid
     * @return
     */
    ResponseEntity<Resource> getFileStream(String fileUuid)throws Exception;

    /**
     * 获取文件fileUuids
     * @param fileGroupKey
     * @return
     */
    List<String> getFileUuids(String fileGroupKey)throws Exception;

    /**
     * 获取oss文件名集合
     * @param fileGroupKey
     * @return
     */
    List<String> getOssFileNames(String fileGroupKey)throws Exception;

    /**
     * 单文件下载根据oss文件名
     * @param mapParam
     * @return
     */
    Map<String, Object> singleDownLoadFileByOssFileName(Map mapParam);

    /**
     * 根据fileUuid获取oss文件名
     * @param fileUuid
     * @return
     */
    String getOssFileNameByFileUuid(String fileUuid) throws Exception;

    /**
     * 获取下载地址
     * @param fileUuid
     * @return
     */
    String getDownLoadUrl(String fileUuid)throws  Exception;

    /**
     * 通过文件组key 值获取 文件下载地址
     * @param fileGroupKey
     * @return
     */
    List<String>  getDownloadUrlByFileGroupKey(String fileGroupKey)throws Exception;
}
